package com.xujl.hsns.codec.impl;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

import com.xujl.hsns.codec.HSNSCodecFactory;

public class XMLCodecFactory implements HSNSCodecFactory {

	public XMLCodecFactory(Class decodeClazz){
		decoder= new JSONDecoder(decodeClazz);
		encoder= new JSONEncoder();
	}
	
	 private final JSONEncoder encoder;
	 
	 private final JSONDecoder decoder;
	
	public ProtocolDecoder getDecoder(IoSession session) throws Exception {
		return decoder;
	}

	public ProtocolEncoder getEncoder(IoSession session) throws Exception {
		return encoder;
	}

}
